In the effort to add multi language support to the hotelsoftware web app we first handled the front facing javascript for the online booking tool and now we address the backend where some of the fields need to be stored in multiple languages. Mostly policy information and the whole product descriptions
As I do not want to be limited to certain languages it makes sense to have the elements which need to be translated in a separate table flor each of the models in the rails app.
We need to translate only certain fields of the dynamic data in the app.
Static data should not be replicated.
I choose the Globalize2 Rails Plugin to do this. These are the steps to follow to set it up.
- add fields to the model
- create a migration where the table is set up
- migrate the original tables data into the model translation table
- set up the application controller for globalize
- language selection
- extend the url with a locale flag
- set some urls to switch the language in your views
- brace for heavy editing and updating of config/locale yml files
I was thinking of implementing this from scratch, but figured someone must have figured that out already http://stackoverflow.com/questions/1322881/database-localization